<!DOCTYPE html>
<html lang="en-US">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>xiaobu-water-marker的使用 | 爆米花小布</title>
    <meta name="generator" content="VuePress 1.9.7">
    <link rel="icon" href="/favicon.ico">
    <script defer="defer" async="async" src="//cpro.baidustatic.com/cpro/ui/cm.js"></script>
    <meta name="description" content=" ">
    
    <link rel="preload" href="/assets/css/0.styles.54de4a22.css" as="style"><link rel="preload" href="/assets/js/app.36e8cb25.js" as="script"><link rel="preload" href="/assets/js/2.cd8e88cf.js" as="script"><link rel="preload" href="/assets/js/34.3db00b39.js" as="script"><link rel="prefetch" href="/assets/js/10.5a175a73.js"><link rel="prefetch" href="/assets/js/11.7c8d5810.js"><link rel="prefetch" href="/assets/js/12.c77aca0d.js"><link rel="prefetch" href="/assets/js/13.fc475cb0.js"><link rel="prefetch" href="/assets/js/14.517ed6e7.js"><link rel="prefetch" href="/assets/js/15.7dc9cc39.js"><link rel="prefetch" href="/assets/js/16.4223237a.js"><link rel="prefetch" href="/assets/js/17.0e3dcd26.js"><link rel="prefetch" href="/assets/js/18.132512c7.js"><link rel="prefetch" href="/assets/js/19.55275db3.js"><link rel="prefetch" href="/assets/js/20.621b52a1.js"><link rel="prefetch" href="/assets/js/21.daa66e46.js"><link rel="prefetch" href="/assets/js/22.537fd259.js"><link rel="prefetch" href="/assets/js/23.81c79725.js"><link rel="prefetch" href="/assets/js/24.ee80a08c.js"><link rel="prefetch" href="/assets/js/25.260c7616.js"><link rel="prefetch" href="/assets/js/26.03e10148.js"><link rel="prefetch" href="/assets/js/27.768e5af1.js"><link rel="prefetch" href="/assets/js/28.ad0f08eb.js"><link rel="prefetch" href="/assets/js/29.9e188b97.js"><link rel="prefetch" href="/assets/js/3.9cba588d.js"><link rel="prefetch" href="/assets/js/30.f2aa9a7c.js"><link rel="prefetch" href="/assets/js/31.93c74095.js"><link rel="prefetch" href="/assets/js/32.4735eb89.js"><link rel="prefetch" href="/assets/js/33.7b05518b.js"><link rel="prefetch" href="/assets/js/35.ea9a0227.js"><link rel="prefetch" href="/assets/js/36.5873bde7.js"><link rel="prefetch" href="/assets/js/37.2cbd5350.js"><link rel="prefetch" href="/assets/js/38.6c2de9e4.js"><link rel="prefetch" href="/assets/js/39.d3c0116f.js"><link rel="prefetch" href="/assets/js/4.97aec80c.js"><link rel="prefetch" href="/assets/js/40.47b05f9f.js"><link rel="prefetch" href="/assets/js/41.5dfb852e.js"><link rel="prefetch" href="/assets/js/42.1d7cf4c2.js"><link rel="prefetch" href="/assets/js/43.43f59d94.js"><link rel="prefetch" href="/assets/js/44.19309bf6.js"><link rel="prefetch" href="/assets/js/45.dbee3f0a.js"><link rel="prefetch" href="/assets/js/46.a373745d.js"><link rel="prefetch" href="/assets/js/5.bc4ebf1d.js"><link rel="prefetch" href="/assets/js/6.805bb5f3.js"><link rel="prefetch" href="/assets/js/7.9724c5a3.js"><link rel="prefetch" href="/assets/js/8.6c6d5662.js"><link rel="prefetch" href="/assets/js/9.641efeda.js">
    <link rel="stylesheet" href="/assets/css/0.styles.54de4a22.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/" class="home-link router-link-active"><!----> <span class="site-name">爆米花小布</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/" class="nav-link">
  主页
</a></div><div class="nav-item"><a href="/element-ui/el-table-select-all/" class="nav-link">
  前端博客
</a></div><div class="nav-item"><a href="https://shenxiaobu.github.io/vue-element-dict/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  PC端字典插件包
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://shenxiaobu.github.io/vue-vant-dict" target="_blank" rel="noopener noreferrer" class="nav-link external">
  移动端字典插件包
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="/" class="nav-link">
  主页
</a></div><div class="nav-item"><a href="/element-ui/el-table-select-all/" class="nav-link">
  前端博客
</a></div><div class="nav-item"><a href="https://shenxiaobu.github.io/vue-element-dict/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  PC端字典插件包
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://shenxiaobu.github.io/vue-vant-dict" target="_blank" rel="noopener noreferrer" class="nav-link external">
  移动端字典插件包
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav>  <ul class="sidebar-links"><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>Element-ui组件使用经验</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/element-ui/el-table-select-all/" class="sidebar-link">使用el-table实现全选功能</a></li><li><a href="/element-ui/el-table-sku/" class="sidebar-link">利用element实现sku规格相关功能</a></li><li><a href="/element-ui/el-cropper/" class="sidebar-link">利用vue-cropper实现图片裁剪功能</a></li><li><a href="/element-ui/el-form-nesting/" class="sidebar-link">el-form嵌套表单校验</a></li><li><a href="/element-ui/el-theme/" class="sidebar-link">使用element-ui组件库实现主题切换功能</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>JS必备知识</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/JS/call-apply-bind/" class="sidebar-link">js中的call、apply和bind</a></li><li><a href="/JS/debounce-throttle/" class="sidebar-link">JS中防抖与节流的讲解与封装</a></li><li><a href="/JS/tree-data/" class="sidebar-link">JS中树形结构数据相关方法</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>CSS实战经验</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/CSS/contour-layout/" class="sidebar-link">css实现等高布局</a></li><li><a href="/CSS/fixed-aspect-ratio/" class="sidebar-link">css实现固定宽高比</a></li><li><a href="/CSS/draw-triangle/" class="sidebar-link">CSS画一个三角形</a></li><li><a href="/CSS/draw-ring/" class="sidebar-link">CSS画一个环形进度条</a></li><li><a href="/CSS/pseudo-class/" class="sidebar-link">伪类和伪元素的区别与使用</a></li><li><a href="/CSS/clear-float/" class="sidebar-link">清除浮动的原理与时机</a></li><li><a href="/CSS/layout/" class="sidebar-link">三栏布局问题（左右固定宽度 中间自适应）</a></li><li><a href="/CSS/flex/" class="sidebar-link">flex布局祥解</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading open"><span>实用的npm包</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/npm/xiaobu-pic-zoom/" class="sidebar-link">xiaobu-pic-zoom图片放大镜</a></li><li><a href="/npm/vue-message-code/" class="sidebar-link">vue-message-code短信验证码</a></li><li><a href="/npm/xiaobu-water-marker/" aria-current="page" class="active sidebar-link">xiaobu-water-marker水印</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/npm/xiaobu-water-marker/#安装" class="sidebar-link">安装</a></li><li class="sidebar-sub-header"><a href="/npm/xiaobu-water-marker/#引入" class="sidebar-link">引入</a></li><li class="sidebar-sub-header"><a href="/npm/xiaobu-water-marker/#使用" class="sidebar-link">使用</a></li></ul></li><li><a href="/npm/vue-flutter/" class="sidebar-link">vue-flutter漂浮动画</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>VUE小妙招</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/vue-config/search-menu/" class="sidebar-link">利用fuse.js实现搜索菜单功能</a></li><li><a href="/vue-config/alias/" class="sidebar-link">vue项目配置别名</a></li><li><a href="/vue-config/svg-sprite-loader/" class="sidebar-link">vue项目配置使用svg图标</a></li><li><a href="/vue-config/vue-mode-env/" class="sidebar-link">vue项目的模式和环境变量</a></li><li><a href="/vue-config/system-config/" class="sidebar-link">vue项目配置系统变量</a></li><li><a href="/vue-config/axios-optimization-one/" class="sidebar-link">vue项目axios请求优化（一）</a></li><li><a href="/vue-config/axios-optimization-two/" class="sidebar-link">vue项目axios请求优化（二）</a></li><li><a href="/vue-config/axios-optimization-three/" class="sidebar-link">vue项目axios请求优化（三）</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>前端工具</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/tool/use-nvm/" class="sidebar-link">nvm的使用</a></li><li><a href="/tool/vscode/sftp/" class="sidebar-link">vscode插件之sftp</a></li><li><a href="/tool/vscode/koroFileHeader/" class="sidebar-link">vscode插件之koroFileHeader</a></li></ul></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="xiaobu-water-marker的使用"><a href="#xiaobu-water-marker的使用" class="header-anchor">#</a> xiaobu-water-marker的使用</h1> <h2 id="安装"><a href="#安装" class="header-anchor">#</a> 安装</h2> <div class="language-shell extra-class"><pre class="language-shell"><code><span class="token comment">#install by yarn</span>
<span class="token function">yarn</span> <span class="token function">add</span> xiaobu-water-marker

<span class="token comment">#install by npm</span>
<span class="token function">npm</span> <span class="token function">install</span> xiaobu-water-marker
</code></pre></div><h2 id="引入"><a href="#引入" class="header-anchor">#</a> 引入</h2> <div class="language-js extra-class"><pre class="language-js"><code><span class="token keyword">import</span> <span class="token punctuation">{</span> XiaobuWaterMarker <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">&quot;xiaobu-water-marker&quot;</span>
Vue<span class="token punctuation">.</span><span class="token function">use</span><span class="token punctuation">(</span>XiaobuWaterMarker<span class="token punctuation">)</span>
或者

<span class="token keyword">const</span> XiaobuWaterMarker <span class="token operator">=</span> <span class="token function">require</span><span class="token punctuation">(</span><span class="token string">&quot;xiaobu-water-marker&quot;</span><span class="token punctuation">)</span>
Vue<span class="token punctuation">.</span><span class="token function">use</span><span class="token punctuation">(</span>XiaobuWaterMarker<span class="token punctuation">)</span>
</code></pre></div><h2 id="使用"><a href="#使用" class="header-anchor">#</a> 使用</h2> <h3 id="水印文字"><a href="#水印文字" class="header-anchor">#</a> 水印文字</h3> <div class="language-vue extra-class"><pre class="language-vue"><code><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>xiaobu-water-marker</span> <span class="token attr-name">text</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>爆米花小布<span class="token punctuation">&quot;</span></span> <span class="token punctuation">/&gt;</span></span>
</code></pre></div><!----> <h3 id="配置参数"><a href="#配置参数" class="header-anchor">#</a> 配置参数</h3> <table><thead><tr><th>字段</th> <th>说明</th> <th>类型</th> <th>默认值</th></tr></thead> <tbody><tr><td>text</td> <td>文字水印文本</td> <td>String</td> <td>空（必传）</td></tr> <tr><td>text-color</td> <td>文本颜色</td> <td>String</td> <td>rgb(180, 180, 180)(同css的Color属性可取值)</td></tr> <tr><td>canvas-font</td> <td>字体大小</td> <td>String</td> <td>16px Source Han Sans</td></tr> <tr><td>width</td> <td>文本容器宽度</td> <td>Number</td> <td>124</td></tr> <tr><td>height</td> <td>文本容器高度</td> <td>Number</td> <td>124</td></tr> <tr><td>z-index</td> <td>文本容器的层级</td> <td>Number</td> <td>9</td></tr> <tr><td>opacity</td> <td>文本容器的透明度</td> <td>String</td> <td>0.3</td></tr> <tr><td>rotate-deg</td> <td>文字旋转的角度</td> <td>Number</td> <td>20</td></tr> <tr><td>rotate-direction</td> <td>文字旋转的方向</td> <td>String</td> <td>clockwise 顺时针 anti-clockwise 逆时针（默认）</td></tr> <tr><td>crisscross</td> <td>水印文字是否隔行交错</td> <td>Boolean</td> <td>false</td></tr> <tr><td>margin-left</td> <td>水印交错的距离</td> <td>Number</td> <td>文本宽度的一半（传入负数时会取绝对值）</td></tr> <tr><td>odd-or-even</td> <td>奇数行或偶数行做左边距的交错</td> <td>Number</td> <td>0 奇数 1 偶数（默认）</td></tr> <tr><td>text-padding</td> <td>文本左右内边距（解决当文本旋转一定角度时文本显示不全的问题）</td> <td>Number</td> <td>0 传入负数时会取绝对值</td></tr></tbody></table> <h3 id="水印图片"><a href="#水印图片" class="header-anchor">#</a> 水印图片</h3> <div class="language-vue extra-class"><pre class="language-vue"><code><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>xiaobu-water-marker</span> <span class="token attr-name">:imgSrc</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>require(<span class="token punctuation">'</span>./imgs/12blue.jpg<span class="token punctuation">'</span>)<span class="token punctuation">&quot;</span></span> <span class="token punctuation">/&gt;</span></span>
</code></pre></div><!----> <h3 id="配置参数-2"><a href="#配置参数-2" class="header-anchor">#</a> 配置参数</h3> <table><thead><tr><th style="text-align:center;">字段</th> <th style="text-align:center;">说明</th> <th style="text-align:center;">类型</th> <th style="text-align:center;">默认值</th></tr></thead> <tbody><tr><td style="text-align:center;">width</td> <td style="text-align:center;">文本容器宽度</td> <td style="text-align:center;">Number</td> <td style="text-align:center;">124</td></tr> <tr><td style="text-align:center;">height</td> <td style="text-align:center;">文本容器高度</td> <td style="text-align:center;">Number</td> <td style="text-align:center;">124</td></tr> <tr><td style="text-align:center;">z-index</td> <td style="text-align:center;">文本容器的层级</td> <td style="text-align:center;">Number</td> <td style="text-align:center;">9</td></tr> <tr><td style="text-align:center;">opacity</td> <td style="text-align:center;">文本容器的透明度</td> <td style="text-align:center;">String</td> <td style="text-align:center;">0.3</td></tr> <tr><td style="text-align:center;">rotate-deg</td> <td style="text-align:center;">文字旋转的角度</td> <td style="text-align:center;">Number</td> <td style="text-align:center;">20</td></tr> <tr><td style="text-align:center;">rotate-direction</td> <td style="text-align:center;">文字旋转的方向</td> <td style="text-align:center;">String</td> <td style="text-align:center;">clockwise 顺时针 anti-clockwise 逆时针（默认）</td></tr> <tr><td style="text-align:center;">crisscross</td> <td style="text-align:center;">水印文字是否隔行交错</td> <td style="text-align:center;">Boolean</td> <td style="text-align:center;">false</td></tr> <tr><td style="text-align:center;">margin-left</td> <td style="text-align:center;">水印交错的距离</td> <td style="text-align:center;">Number</td> <td style="text-align:center;">文本宽度的一半（传入负数时会取绝对值）</td></tr> <tr><td style="text-align:center;">odd-or-even</td> <td style="text-align:center;">奇数行或偶数行做左边距的交错</td> <td style="text-align:center;">Number</td> <td style="text-align:center;">0 奇数 1 偶数（默认）</td></tr> <tr><td style="text-align:center;">left-instance</td> <td style="text-align:center;">图片左边内间距</td> <td style="text-align:center;">Number</td> <td style="text-align:center;">20</td></tr> <tr><td style="text-align:center;">right-instance</td> <td style="text-align:center;">图片右边内间距</td> <td style="text-align:center;">Number</td> <td style="text-align:center;">20</td></tr> <tr><td style="text-align:center;">top-instance</td> <td style="text-align:center;">图片上边内间距</td> <td style="text-align:center;">Number</td> <td style="text-align:center;">20</td></tr> <tr><td style="text-align:center;">bottom-instance</td> <td style="text-align:center;">图片下边内间距</td> <td style="text-align:center;">Number</td> <td style="text-align:center;">20</td></tr> <tr><td style="text-align:center;">gray-img</td> <td style="text-align:center;">是否将图片置灰</td> <td style="text-align:center;">Boolean</td> <td style="text-align:center;">true</td></tr> <tr><td style="text-align:center;">rgb-num</td> <td style="text-align:center;">置灰系数</td> <td style="text-align:center;">Array</td> <td style="text-align:center;">[0.299, 0.587, 0.114]</td></tr> <tr><td style="text-align:center;">img-color</td> <td style="text-align:center;">图片颜色</td> <td style="text-align:center;">String</td> <td style="text-align:center;">无默认值 十六进制逗号隔开 如 &quot;255,0,125&quot;</td></tr></tbody></table> <div class="language-vue extra-class"><pre class="language-vue"><code><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>xiaobu-water-marker</span> 
  <span class="token attr-name">:imgSrc</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>require(<span class="token punctuation">'</span>./imgs/12blue.jpg<span class="token punctuation">'</span>)<span class="token punctuation">&quot;</span></span> 
  <span class="token attr-name">:width</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>66<span class="token punctuation">&quot;</span></span> 
  <span class="token attr-name">:height</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>66<span class="token punctuation">&quot;</span></span> 
  <span class="token attr-name">:z-index</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>1<span class="token punctuation">&quot;</span></span> 
  <span class="token attr-name">opacity</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>1<span class="token punctuation">&quot;</span></span> 
  <span class="token attr-name">:rotate-deg</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>10<span class="token punctuation">&quot;</span></span> 
  <span class="token attr-name">rotate-direction</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>clockwise<span class="token punctuation">&quot;</span></span> 
  <span class="token attr-name">:crisscross</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>true<span class="token punctuation">&quot;</span></span> 
  <span class="token attr-name">:margin-left</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>-20<span class="token punctuation">&quot;</span></span> 
  <span class="token attr-name">:odd-or-even</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>0<span class="token punctuation">&quot;</span></span> 
  <span class="token attr-name">:left-instance</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>50<span class="token punctuation">&quot;</span></span> 
  <span class="token attr-name">:right-instance</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>50<span class="token punctuation">&quot;</span></span> 
  <span class="token attr-name">:top-instance</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>50<span class="token punctuation">&quot;</span></span> 
  <span class="token attr-name">:bottom-instance</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>100<span class="token punctuation">&quot;</span></span> 
  <span class="token attr-name">:rgb-num</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>[1,1,1]<span class="token punctuation">&quot;</span></span> 
  <span class="token attr-name">:gray-img</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>false<span class="token punctuation">&quot;</span></span> 
  <span class="token attr-name">img-color</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>0,0,255<span class="token punctuation">&quot;</span></span> 
<span class="token punctuation">/&gt;</span></span>
</code></pre></div><p><strong>img-color gray-img rgb-num 同时存在时 img-color有效 其余两个无效</strong></p> <p><strong>rgb-num 当且仅当 gray-img 为true 且未传入 img-color 时 有效</strong></p> <div class="language-vue extra-class"><pre class="language-vue"><code>  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>img-box<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>
      <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>img</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>img<span class="token punctuation">&quot;</span></span> <span class="token attr-name">:src</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>require(<span class="token punctuation">'</span>./imgs/12blue.jpg<span class="token punctuation">'</span>)<span class="token punctuation">&quot;</span></span> <span class="token attr-name">alt</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span><span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>
      <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>xiaobu-water-marker</span> 
        <span class="token attr-name">:showCanvas</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>true<span class="token punctuation">&quot;</span></span> 
        <span class="token attr-name">:openGuide</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>true<span class="token punctuation">&quot;</span></span> 
        <span class="token attr-name">:width</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>100<span class="token punctuation">&quot;</span></span> 
        <span class="token attr-name">text-baseline</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>bottom<span class="token punctuation">&quot;</span></span>  
        <span class="token attr-name">textAlign</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>right<span class="token punctuation">&quot;</span></span> 
        <span class="token attr-name">:waterText</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>true<span class="token punctuation">&quot;</span></span> 
        <span class="token attr-name">:height</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>100<span class="token punctuation">&quot;</span></span> 
        <span class="token attr-name">text-color</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>#fff<span class="token punctuation">&quot;</span></span> 
        <span class="token attr-name">opacity</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>1<span class="token punctuation">&quot;</span></span> 
        <span class="token attr-name">:rotateDeg</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>0<span class="token punctuation">&quot;</span></span> 
        <span class="token attr-name">:isParentStatic</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>false<span class="token punctuation">&quot;</span></span> 
        <span class="token attr-name">text</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>小小小布<span class="token punctuation">&quot;</span></span>
      <span class="token punctuation">/&gt;</span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
</code></pre></div><table><thead><tr><th>字段</th> <th>说明</th> <th>类型</th> <th>默认值</th></tr></thead> <tbody><tr><td>showCanvas</td> <td>是否展示canvas元素</td> <td>Boolean</td> <td>false</td></tr> <tr><td>waterText</td> <td>是否水印图片</td> <td>Boolean</td> <td>false</td></tr> <tr><td>centerX</td> <td>水印文字x轴距离</td> <td>Number</td> <td>-</td></tr> <tr><td>centerY</td> <td>水印文字Y轴距离</td> <td>Number</td> <td>-</td></tr> <tr><td>openGuide</td> <td>是否打开参考线</td> <td>Boolean</td> <td>false</td></tr> <tr><td>guideColor</td> <td>参考线颜色</td> <td>String</td> <td>#eee</td></tr></tbody></table></div> <footer class="page-edit"><!----> <!----></footer> <div class="page-nav"><p class="inner"><span class="prev">
      ←
      <a href="/npm/vue-message-code/" class="prev">
        vue-message-code短信验证码
      </a></span> <span class="next"><a href="/npm/vue-flutter/">
        vue-flutter漂浮动画
      </a>
      →
    </span></p></div> </main></div><div class="global-ui"><div id="loading-mask"><div class="loading-wrapper"><span class="loading-dot loading-dot-spin"><i></i> <i></i> <i></i> <i></i></span></div></div><!----></div></div>
    <script src="/assets/js/app.36e8cb25.js" defer></script><script src="/assets/js/2.cd8e88cf.js" defer></script><script src="/assets/js/34.3db00b39.js" defer></script>
  </body>
</html>
